package com.example.libbase.utils;

import android.util.Log;

/**
 * 日志工具类（简单处理）
 * 1.TAG
 * 2.LOG开关
 *
 * @author hermit
 * @date 2021/6/20 14:12
 */
public class Logger {

    private static String TAG = "TAG";
    private static boolean SHOW_LOG = true;

    public static void init(String tag, boolean isShowLog) {
        TAG = tag;
        SHOW_LOG = isShowLog;
    }

    public static void i(String str) {
        if (SHOW_LOG) {
            Log.i(TAG, str);
        }
    }

    public static void i(String tag, String str) {
        if (SHOW_LOG) {
            Log.i(tag, str);
        }
    }

    public static void w(String str) {
        if (SHOW_LOG) {
            Log.w(TAG, str);
        }
    }

    public static void w(String tag, String str) {
        if (SHOW_LOG) {
            Log.w(tag, str);
        }
    }

    public static void e(String str) {
        if (SHOW_LOG) {
            Log.e(TAG, str);
        }
    }

    public static void e(String tag, String str) {
        if (SHOW_LOG) {
            Log.e(tag, str);
        }
    }
}
